import time
from machine import Pin

def led_light():
    # 实现灯闪烁
    print('实现灯闪烁')
    # 引脚2为输出引脚
    led = Pin(2, Pin.OUT)

    while 1:
        led.value(1)
        time.sleep(1)
        led.value(0)
        time.sleep(1)

if __name__ == '__main__':
    led_light()
